﻿Imports Licenta3.Common.Framework
Imports System.Collections.ObjectModel
Imports System.Data
Imports System.IO
Imports Autodesk.AutoCAD.Geometry
Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices

Namespace Common.Classes
    Public Class ChitantaClass
        Public Property NrChitanta As Integer
        Public Property DataChitanta As Date = Today
    End Class
    Public Class UAT
        Inherits ObjectBase
        Private _Denumire As String
        Public Property Denumire As String
            Get
                Return _Denumire
            End Get
            Set(value As String)
                _Denumire = value
                OnPropertyChanged("Denumire")
            End Set
        End Property
        Private _SIRSUP As String
        Public Property SIRSUP As String
            Get
                Return _SIRSUP
            End Get
            Set(value As String)
                _SIRSUP = value
                OnPropertyChanged("SIRSUP")
            End Set
        End Property
        Private _CountyId As Integer
        Public Property CountyId As Integer
            Get
                Return _CountyId
            End Get
            Set(value As Integer)
                _CountyId = value
                OnPropertyChanged("CountyId")
            End Set
        End Property
        Private _AdministrativeUnitId As Integer
        Property AdministrativeUnitId As Integer
            Get
                Return _AdministrativeUnitId
            End Get
            Set(value As Integer)
                _AdministrativeUnitId = value
                OnPropertyChanged("AdministrativeUnitId")
            End Set
        End Property
    End Class
    <Serializable>
    Public Class Punct
        Inherits ObjectBase
        Private _Id As Integer
        Public Property Id As Integer
            Get
                Return id
            End Get
            Set(value As Integer)
                _id = value
                OnPropertyChanged(id)
            End Set
        End Property
        Private _Coordinates As Point

        Public Property Coordinates As Point
            Get
                Return _Coordinates
            End Get
            Set(value As Point)
                _Coordinates = value
                OnPropertyChanged("Coordinates")
            End Set
        End Property
        <NonSerialized> Private _Geometry As New Point2d
        <System.Xml.Serialization.XmlIgnore> Public Property Geometry As Point2d
            Get
                Return _Geometry
            End Get
            Set(value As Point2d)
                _Geometry = value
                OnPropertyChanged("Geometry")
            End Set
        End Property

        Public Sub New()

        End Sub
    End Class
    Public Class TAutorizat
        Inherits PersoanaClass
        'Private _IsPF As Boolean
        'Public Overrides Property IsPF As Boolean
        '    Get
        '        Return _IsPF
        '    End Get
        '    Set(value As Boolean)
        '        _IsPF = value
        '        OnPropertyChanged("IsPF")
        '    End Set
        'End Property
        'Public Property serie As String
        'Private _SerieCI As String
        'Public Overrides Property SerieCI As String
        '    Get
        '        Return _SerieCI
        '    End Get
        '    Set(value As String)
        '        If IsPF Then
        '            _SerieCI = value
        '            OnPropertyChanged("SerieCI")
        '        End If
        '    End Set
        'End Property
        'Private _NrCI As String
        'Public Overrides Property NrCI As String
        '    Get
        '        Return _NrCI
        '    End Get
        '    Set(value As String)
        '        If IsPF Then
        '            _NrCI = value
        '            OnPropertyChanged("NrCI")
        '        End If
        '    End Set
        'End Property
        Private _Serie As String
        Public Property Serie As String
            Get
                Return _Serie
            End Get
            Set(value As String)
                _Serie = value
            End Set
        End Property
        Private _DefaultOCPI As New Dictionar.OCPIClass
        Public Property DefaultOCPI As Dictionar.OCPIClass
            Get
                Return _DefaultOCPI
            End Get
            Set(value As Dictionar.OCPIClass)
                _DefaultOCPI = value
                OnPropertyChanged("DefaultOCPI")
            End Set
        End Property
        Private _DefaultBCPI As New Dictionar.OCPIClass.BCPIClass
        Public Property DefaultBCPI As Dictionar.OCPIClass.BCPIClass
            Get
                Return _DefaultBCPI
            End Get
            Set(value As Dictionar.OCPIClass.BCPIClass)
                _DefaultBCPI = value
                OnPropertyChanged("DefaultBCPI")
            End Set
        End Property
    End Class
    Public Class Dictionar
        Inherits ObjectBase
        Private _OCPI As New ObservableCollection(Of OCPIClass)
        Public Property OCPI As ObservableCollection(Of OCPIClass)
            Get
                Return _OCPI
            End Get
            Set(value As ObservableCollection(Of OCPIClass))
                _OCPI = value
                OnPropertyChanged("OCPI")
            End Set
        End Property
        Public Class OCPIClass
            Inherits ObjectBase
            Public Property cod As String
            Public Property denumire As String
            Private _BCPI As New ObservableCollection(Of BCPIClass)
            Public Property BCPI As ObservableCollection(Of BCPIClass)
                Get
                    Return _BCPI
                End Get
                Set(value As ObservableCollection(Of BCPIClass))
                    _BCPI = value
                    OnPropertyChanged("BCPI")
                End Set
            End Property
            Public Class BCPIClass
                Inherits ObjectBase
                Public Property cod As String
                Public Property denumire As String
            End Class
        End Class
    End Class
    Public Enum Scari
        la200 = 200
        la500 = 500
        la1000 = 1000
        la2000 = 2000
        la5000 = 5000
        NA = -1
    End Enum
    Public NotInheritable Class TipDocCadastrala
        Private _valuesD As New ObservableCollection(Of String)
        Public ReadOnly Property values As ObservableCollection(Of String)
            Get
                Return _valuesD
            End Get
        End Property
        Public Enum EnumDocCadastrala
            PrimaInscriere
            PrimaInscriereUI
            Dezlipire
            Alipire
            InscriereConstructie
            ModificareaLimitei
            ModificareaSuprafetei
            DescriereaDezmembramintelor
            Reconstituire
        End Enum

        Sub New(ParamArray toRemove() As EnumDocCadastrala)
            _valuesD.Add("Prima inscriere")
            _valuesD.Add("Prima inscriereUI")
            _valuesD.Add("Dezlipire")
            _valuesD.Add("Alipire")
            _valuesD.Add("Inscriere constructie definitiva")
            _valuesD.Add("Modificarea limitei")
            _valuesD.Add("Modificarea suprafetei")
            _valuesD.Add("Descrierea dezmembramintelor")
            _valuesD.Add("Reconstituire")
            For i = toRemove.Count - 1 To 0 Step -1
                _valuesD.RemoveAt(toRemove(i))
            Next i
        End Sub
    End Class
    Public NotInheritable Class TipInscriere
        Shared _valuesD As New ObservableCollection(Of String)
        Public Shared ReadOnly Property values As ObservableCollection(Of String)
            Get
                Return _valuesD
            End Get
        End Property
        Shared Sub New()
            _valuesD.Add("Întabulare")
            _valuesD.Add("Înscriere Provizorie")
            _valuesD.Add("Notare")
            _valuesD.Add("Radiere")
        End Sub
    End Class
    Public NotInheritable Class CategorieFolosinta
        Shared _valuesD As New Dictionary(Of String, String)
        Public Shared ReadOnly Property values As Dictionary(Of String, String)
            Get
                Return _valuesD
            End Get
        End Property
        Shared Sub New()
            _valuesD.Add("A", "Arabil")
            _valuesD.Add("V", "Vie")
            _valuesD.Add("L", "Livadă")
            _valuesD.Add("P", "Pășune")
            _valuesD.Add("F", "Fâneață")
            _valuesD.Add("PD", "Pădure")
            _valuesD.Add("HR", "Apă curgătoare")
            _valuesD.Add("HB", "Apă stătătoare")
            _valuesD.Add("DR", "Drum")
            _valuesD.Add("CF", "Cale ferată")
            _valuesD.Add("CC", "Curți-Construcții")
            _valuesD.Add("C", "Construcție")
            _valuesD.Add("N", "Neproductiv")
        End Sub
    End Class
    Public NotInheritable Class TipPlati
        Shared _valuesP As New ObservableCollection(Of String)
        Public Shared ReadOnly Property values As ObservableCollection(Of String)
            Get
                Return _valuesP
            End Get
        End Property
        Shared Sub New()
            _valuesP.Add("Numerar")
            _valuesP.Add("Ordin de plată")
            _valuesP.Add("Cec")
            _valuesP.Add("Card")
        End Sub
    End Class
    Public NotInheritable Class TipRaspuns
        Shared _valuesP As New ObservableCollection(Of String)
        Public Shared ReadOnly Property values As ObservableCollection(Of String)
            Get
                Return _valuesP
            End Get
        End Property
        Shared Sub New()
            _valuesP.Add("biroul de cadastru")
            _valuesP.Add("poștă")
            _valuesP.Add("fax")
        End Sub
    End Class
    Public Class DS
        Public Shared Property Administrativeunit As New DataSet("Administrativeunit")
        Public Shared Property County As New DataSet("County")
        Public Shared Property Dictionary As New DataSet("Dictionary")
        Public Shared Property Locality As New DataSet("Locality")

        Shared Sub New()
            'Dim ok As Boolean
            'ok = File.Exists(assemblyPath + "\Administrativeunit.xml") And File.Exists(assemblyPath + "\County.xml") And File.Exists(assemblyPath + "\Dictionary.xml") And File.Exists(assemblyPath + "\Locality.xml")
            If File.Exists(assemblyPath + "\Administrativeunit.xml") Then
                _Administrativeunit.ReadXml(assemblyPath + "\Administrativeunit.xml", XmlReadMode.InferTypedSchema)
            End If
            If File.Exists(assemblyPath + "\County.xml") Then
                _County.ReadXml(assemblyPath + "\County.xml")
            End If
            If File.Exists(assemblyPath + "\Dictionary.xml") Then
                _Dictionary.ReadXml(assemblyPath + "\Dictionary.xml")
            End If
            If File.Exists(assemblyPath + "\Locality.xml") Then
                _Locality.ReadXml(assemblyPath + "\Locality.xml")
            End If

        End Sub
    End Class


    Public Class Adresa
        Inherits ObjectBase
        Private _adresaIntreaga As String
        Public Property adresaIntreaga As String
            Get
                Return _adresaIntreaga
            End Get
            Set(value As String)
                _adresaIntreaga = value
                OnPropertyChanged("adresaIntreaga")
            End Set
        End Property

    End Class
End Namespace
